(1) Field of the Invention
The present invention is related to the field of communication frameworks. More specifically, the present invention is related to a method and an apparatus for establishing data routes between a consumer and a producer on a computer system.
(2) Prior Art
Computer systems typically utilize a layered approach for implementing functionalities relating to communications frameworks where a layer is a program module for processing different portions of data traveling from a producer to a consumer. A disadvantage to the layered approach is that it requires examination of data by each layer to determine if any work needs to be performed by that layer before sending the data to the next layer. This examination process requires computer instructions and data to be read by the central processing unit(s) (CPU), consuming CPU cycles and time. For many cases, a given layer may not do any real work. Thus the layered approach to a communication framework is a high cost approach to processing of data.
A well known example of a layered approach is the use of AT&T's STREAMS framework. The interfaces for this framework are well known. STREAMS utilizes a layered approach to build communication services, examples being a protocol stack or a terminal interface. Writing simple STREAMS modules may be easy. From a user level, STREAMS modules can be selected and interconnected without writing any kernel level code provided that the required STREAMS modules have been implemented.
In the STREAMS framework, incoming packets are pushed upstream through independent STREAMS modules in an effort to determine the final destination of the packet. The final destination or consumer, is typically sitting on top of the stream head. For outgoing packets, the packets are pushed downstream in an effort to determine which STREAMS driver should be utilized to transmit the packet. An example of a STREAMS driver is a Networking Interface Unit (NIU) which is a hardware component that sends and receives data over a physical medium. An example of an NIU is an Ethernet Interface.
Several problems exist which are associated with the STREAMS framework. For one, utilizing the STREAMS framework can take approximately 0.002% of available CPU cycles to push a packet between modules. Such overhead quickly adds up in light of the number of STREAMS modules which must be traversed when a packet is being transmitted up and down a data stream. For example, if there are six layered modules, then it takes 0.021% of available CPU cycles to go up and down the layered modules. Another prevalent problem is that there is little code locality. Hence, in a system utilizing virtual memory, for example operating systems implemented in workstations available from Sun Microsystems Inc., code between two modules will not share the same page in memory. This results in an increase in the overhead of a virtual memory subsystem. In addition, the overhead of the framework is enormous in terms of the number of instructions required to implement a STREAMS module. Another problem with the STREAMS framework is that since there is a large amount of code required to implement the framework and because STREAMS is feature rich and complicated, it is difficult to prove that it performs correctly.
Yet another concern is the STREAMS working relationship with a multi-threaded kernel with relatively fine grain locking. The use of fine grain locking is a simple method to improve system performance and is well known in the art. Unfortunately, fine grain locking impacts uni-processor performance by placing too many unnecessary lock related checks in the code path. The performance of the STREAMS framework and the STREAMS modules in the critical code paths may be improved in such a case. However, the kernel implementation of the STREAMS framework is very complex and modifications can be non-trivial.
There is therefore a need for a method and an apparatus for a new and simple communication services framework that has little if any overhead and for which it is easy to prove correctness.